<template>
  <div>
    <h3>{{ msg }}</h3>
    <div v-for="(item, index) in arr" :key="index" class="add">
      <input type="checkbox" :value="item" v-model="hobby" />{{ item }}
    </div>
    <ul>
      <li v-for="item in hobby" :key="item">{{ item }}</li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      msg: "请选择你喜欢的专栏",
      arr: ["科幻", "喜剧", "动漫", "冒险", "科技", "军事", "娱乐", "奇闻"],
      hobby: [],
    };
  },
  methods: {},
};
</script>

<style>
.add {
  display: inline-block;
}
</style>
